package com.yonghui.sandbox.service.impl;

import com.yonghui.sandbox.service.ChildService;
import com.yonghui.sandbox.thread.ChildTread;
import com.yonghui.sandbox.vo.ChildVO;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @description: TODO
 * @author: zhangtong
 * @create: 2021-03-15 15:46
 **/
@Service
public class ChildServiceImpl implements ChildService {
    @Override
    public void getChildMethod(String name) {
        ChildTread childTread = new ChildTread(name);
        childTread.start();
        System.out.println("getChildMethod");
    }

    @Async
    @Override
    public ChildVO getAsyncChild(String name) {
        ChildVO childVO = new ChildVO();
        childVO.setId(23);
        childVO.setName(name);
        childVO.setDesc("HI," + name);
        System.out.println(childVO);
        return childVO;
    }
}
